package com.kitchen.service.impl;

import com.kitchen.mapper.ImagesMapper ;
import com.kitchen.beans.entity.Images;
import com.kitchen.service.ImagesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class ImagesServiceImpl implements ImagesService {
    @Autowired
    ImagesMapper imagesMapper;
    @Override
    public int addImage(String file1) {
        Images images = new Images();
        images.setI_path(file1);
        List<Images> select = imagesMapper.select(images);
        if (select.size()==0){
            int insert = imagesMapper.insert(images);
            return insert;
        }
        return 0;
    }
}
